#include <iostream>
class Widget
{
public:
    static const int gender;
    // 如果不进行初始化，那么编译就会报错 declaration of constexpr static data member 'maxAge' requires an initializer
    static constexpr int maxAge = 10000;
};

constexpr int dobubleNum(int nu) {
    return nu * 2;
}
// 这个有啥作用呢？
// https://stackoverflow.com/questions/24790287/templates-int-t-c
// https://stackoverflow.com/questions/499106/what-does-template-unsigned-int-n-mean
template <int N>
constexpr int age = N;

const int Widget::gender = 0;
int const_expr_main()
{
    std::cout << "Widget::gender is " << Widget::gender << std::endl;
    int array[dobubleNum(3)] = {9}; // 如果不加constexpr，那么就是编译不通过的，因为array元素个数的初始化，必须在编译时确定。
    std::cout << "array[0] is " << array[0] << std::endl;
    std::cout << "age<100> is " << age<100> << std::endl;
    return 0;
}
